home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 2.5 KB | 78 lines | [TEXT/ToyS] |
- property kasLocation : {0, 0} -- Start location of 0,0 centers the window initially
- property kasFlocation : {0, 0} -- Start location of 0,0 centers the window initially
-
- -- Some 16-bit colors
- property kFullRed16 : (31 * 1024) -- (0-31) * 1024 for red component
- property kFullGreen16 : (31 * 32) -- (0-31) * 32 for green component
- property kFullBlue16 : 31 -- 0-31 for blue component
-
- property kMediumRed16 : (23 * 1024)
- property kMediumGreen16 : (23 * 32)
- property kMediumBlue16 : 23
-
- property kMediumPurple16 : kMediumRed16 + kMediumBlue16
-
- property kDarkRed16 : (15 * 1024)
- property kDarkGreen16 : (15 * 32)
- property kDarkBlue16 : 15
-
- property kasTimeHHMMSS : 7 * (16 ^ 0) + 14 * (16 ^ 1) + 9 * (16 ^ 2) + 14 * (16 ^ 3) + 10 * (16 ^ 4) -- "HH:MM:SS" for Akua Data
-
-
- global gasInfo -- Our info window
- global gasFloat -- Our floating window
- global gasCount -- A li'l counter
- global gasInitSecs -- The seconds we started at
-
-
- on run
- set gasCount to 0
- set gasInitSecs to (pause for 0 with seconds timing)
-
- -- Create an info window (use empty title have title bar on left)
- set gasInfo to display info titled ¬
- "Akua's Display Info" message ¬
- "This is an info test!" located at kasLocation -- Default is line 1
-
- -- Create an info window (use empty title have title bar on left)
- set gasFloat to display info titled ¬
- ("Floating Info @ " & (the clock using format kasTimeHHMMSS)) message ¬
- "This is a floater test!" located at kasFlocation ¬
- with flotation -- Default is line 1
-
- -- Notice that line 2 in idle is inserted before this line
- display info gasInfo message ¬
- "This is line 4" at line 4 using color kMediumGreen16 ¬
- using font "Chicago" using size 12
-
- display info gasFloat message ¬
- "This is line 5" at line 5 using color kDarkBlue16 ¬
- using font "Chicago" using size 12
- end run
-
-
- on quit
- -- Close our windows
- display info gasInfo with disposal
- display info gasFloat with disposal
- continue quit
- end quit
-
-
- on idle
- set gasCount to gasCount + 1
-
- -- Preserve window location in kasLocation if it is moved
- set kasLocation to screen location of ¬
- (display info gasInfo message ("We've been idled: " & gasCount & " times") ¬
- at line 2 using color kMediumPurple16)
-
- set difSecs to ((pause for 0 with seconds timing) - gasInitSecs) as integer
-
- set kasFlocation to screen location of ¬
- (display info gasFloat message ("We've been floating for: " & difSecs & " seconds") ¬
- at line 3 using color kMediumRed16)
-
- return 1 -- Idle me every second (this should cause first to lines to become permanent, whilst the updated line remains dynamic)
- end idle
-